<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>权限管理左</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="format-detection" content="telephone=no">
    <link rel="stylesheet" href="/layui/css/layui.css" media="all" />
    <link rel="stylesheet" href="/layui_ext/dtree/dtree.css" media="all" />
    <link rel="stylesheet" href="/layui_ext/dtree/font/dtreefont.css" media="all" />
</head>
<body>
<ul id="permissionTree" class="dtree" data-id="0"></ul>
<script type="text/javascript" src="/layui/layui.js"></script>
<script type="text/javascript">
    var DemoTree;
    layui.extend({
        dtree: '/layui_ext/dtree/dtree'
    }).use(['dtree','layer','jquery'], function(){
        var dtree = layui.dtree;
        var layer = layui.layer;
        var $ = layui.jquery;

        // 初始化权限分类树
        DemoTree = dtree.render({
            elem: "#permissionTree",
            dataStyle: "layuiStyle",
            dataFormat: "list",
            skin: "laySimple",
            url: "/menu/tree",
            method: "GET",
            response: {
                statusCode: 0,
                dataName: "data",
                idName: "id",
                menuId: "menuId",
                name: "name"
            },
        });

        // 点击节点刷新右侧
        dtree.on("node(permissionTree)", function (obj) {
            window.parent.right.reloadTable(obj.param.nodeId);
        });
    });
</script>
</body>
</html>